<%@page import="net.tanesha.recaptcha.ReCaptchaFactory"%>
<%@page import="net.tanesha.recaptcha.ReCaptcha"%>
<%
String[] listError = (String[]) request.getAttribute("listError");
String username = (String) request.getAttribute("username");
String email = (String) request.getAttribute("email");
String success = (String) request.getAttribute("success");
String info = (String) request.getAttribute("info");
%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="Forgot password" />
	<jsp:param name="description" value="" />
	<jsp:param name="keywords" value="" />
	<jsp:param name="page" value="home" />
</jsp:include>

        <div id="content">
        	<div id="content_inner">
            	<div id="maincontent">
                    <div id="userform" class="clearafter">
                        <div class="signupform">
                            <h2 class="title">Forgot password</h2>
                            <%
                            if(success==null)
                            {
                            %>
                            <form method="post" action="/forgot-password" name="signupform">
                                <p>
                                    <label>
                                        Email Address
                                        <br />
                                        <input class="input" type="text" name="email" <%=email!=null?"value='"+email+"'":"" %>/>
                                        <%=listError[0]!=null?"<div class=\"error\">"+listError[0]+"</div>":"" %>
                                    </label>
                                </p>
                                <p>
                                	<label>Image Verification
									<script>
							        	var RecaptchaOptions = { theme : 'clean' };
							  		</script>
									<%
										//6LdXmcISAAAAAHz6FsABghup-EayldUCiKQyDPAk //public
										//6LdXmcISAAAAANPIv5ykGg3LAlBMnUQHzy3-Kiqo //private
							          ReCaptcha c = ReCaptchaFactory.newReCaptcha("6LcF-80SAAAAACucExTAmD8RBzETYxDZ35DkbMVF", "6LcF-80SAAAAAM2kArjyUwtVJYbH_DKredY3Q26U", false);
							          out.print(c.createRecaptchaHtml(null, null));
							        %>
							        <%=listError[1]!=null?"<div class=\"error\">"+listError[1]+"</div>":"" %>
							        </label>
                                </p>
                                <p>
                                    <input type="submit" value="Continue" />
                                </p>
                                
                            </form>
                            <%
                            } else {
                            %>
                            <div class="success">
                                <p>Please check your email to get the new password</p>
                            </div>
                            <%
                            }
                            %>
                        </div>
                        <div class="loginform">
                            <h2 class="title">Login</h2>
                            <form method="post" action="/login" name="loginform">
                            	<%=info!=null?"<div class=\"error\">"+info+"</div>":"" %>
                                <p>
                                    <label>
                                        Username
                                        <br />
                                        <input class="input" type="text" name="username" />
                                    </label>                     
                                </p>
                                <p>
                                    <label>
                                        Password
                                        <br />
                                        <input class="input" type="password" name="password" />
                                    </label>
                                </p>
                         
                                <p class="loginsubmit">
                                    <input type="submit" value="Login" />
                                </p>
                                <div class="clearbreak"></div>
                                
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

<%@ include file='/layout/footer.jsp'%>